using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {
	
	//public Transform transform;
	public Terrain terrain;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		
		float terrainHeight = terrain.SampleHeight(transform.position) + 5;
		if(transform.position.y < terrainHeight)
		{
			Vector3 adjustedLocation = new Vector3();
			adjustedLocation = transform.position;
			adjustedLocation.y = terrainHeight;
			//transform.position
		}
	}
}
